﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ServiceConsumer;
using System.Data;

public partial class TestWS : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Write(Convert.ToDateTime("2012-03-24"));
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        //string strUrlWS = "http://aspspider.info/m17tmdt/WebService.asmx";
        string strUrlWS = "http://moving10ws.somee.com/service.asmx";
        //string sFromCity = "46";
        List<object> paras = new List<object>();
        //string fromCity = "1";
        string fromCity = "03";
        //string toCity = "15";
        string toCity = "09";
        string sDimension = "23.5|12|12.3|2.3";
        //string sTranportType = "0";

        object oSID = WSProxy.CallWebService(strUrlWS, "WSLogin", new object[] { "em07business", "123456" });
        paras.Add(oSID);
        paras.Add(fromCity);
        paras.Add(toCity);
        paras.Add(sDimension);
        //paras.Add(sTranportType);
        paras.Add(0);
        paras.Add(DateTime.Now.AddDays(1));
        //paras.Add("03/24/2012");

        object oTranportPrice = WSProxy.CallWebService(strUrlWS, "RoutePrice2", paras.ToArray());
        Response.Write(oTranportPrice);
        //string str = oTranportPrice.ToString();
        //string[] aParas = str.Split('|');

        //string strURL = "http://nganluong.ducquyen.net/WS/WSMoiGioi.asmx";
        //string strUserName = "em07-nkd";
        //string strPass = "em07-nkd";

        //paras = new List<object>();
        //paras.Add(strUserName);
        //paras.Add(strPass);

        //oSID = WSProxy.CallWebService(strURL, "WSLogin", paras.ToArray());
        //string sSID = oSID.ToString();
        //Label1.Text = sSID;
        //if (sSID.Equals("0"))
        //{
        //    Label1.Text = "Thông tin đăng nhập không đúng";
        //    return;
        //}

        //paras = new List<object>();
        //string sCreditCard = "5124868254693534";
        //float fMoney = float.Parse(aParas[1]);
        ////string sSecureCode = "72855";
        ////string sCardHolder = "quangdao";
        //paras.Add(sSID);
        //paras.Add(sCreditCard);
        //paras.Add(fMoney);
        ////paras.Add(sSecureCode);
        ////paras.Add(sCardHolder);
        //object oResult = WSProxy.CallWebService(strURL, "TranferMoneyForCustomer", paras.ToArray());
        //Label2.Text = oResult.ToString();
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        string strUrlWS = "http://nganluong.ducquyen.net/WS/WSHelp.aspx";
        strUrlWS = "http://miracle.somee.com/MiracleService.asmx";
        //string strUrlWS = "http://moving10ws.somee.com/service.asmx";
        //string sFromCity = "46";
        List<object> paras = new List<object>();
        //string fromCity = "1";
        //string toCity = "15";
        //string sDimension = "23.5|12|12.3|2.3";
        //string sTranportType = "0";

        //object oSID = WSProxy.CallWebService(strUrlWS, "WSLogin", new object[] { "em07-nkd", "em07-nkd" });
        object oSID = WSProxy.CallWebService(strUrlWS, "WSLogin", new object[] { "maiquangdao@gmail.com", "123456abc" });

        //object oTrans = WSProxy.CallWebService(strUrlWS, "TraferMoneyForCustomer", new object[] { oSID, "5115378202608031", 123, null, null });
        object oTrans = WSProxy.CallWebService(strUrlWS, "TraferMoneyForCustomer", new object[] { "lz3ojbvn3zsxcuzjzt4h5lut", "5120823759153587", 12, null, null });

        Response.Write(oTrans);

        //paras.Add(oSID);
        //paras.Add(fromCity);
        //paras.Add(toCity);
        //paras.Add(sDimension);
        //paras.Add(sTranportType);
        //paras.Add(DateTime.Now.AddDays(1).ToShortDateString());

        //object oTranportPrice = WSProxy.CallWebService(strUrlWS, "RoutePrice2", paras.ToArray());
        //Response.Write(oTranportPrice);
    }

    protected void Button3_Click(object sender, EventArgs e)
    {
        string strUrlWS = "http://www.em07.somee.com/EWebservice/Service.asmx";
        //strUrlWS = "http://miracle.somee.com/MiracleService.asmx";
        //string strUrlWS = "http://moving10ws.somee.com/service.asmx";
        //string sFromCity = "46";
        List<object> paras = new List<object>();
        //string fromCity = "1";
        //string toCity = "15";
        //string sDimension = "23.5|12|12.3|2.3";
        //string sTranportType = "0";
        paras.Add("");
        //object oSID = WSProxy.CallWebService(strUrlWS, "WSLogin", new object[] { "em07-nkd", "em07-nkd" });
        //object oSID = WSProxy.CallWebService(strUrlWS, "WSLogin", new object[] { "maiquangdao@gmail.com", "123456abc" });

        //object oTrans = WSProxy.CallWebService(strUrlWS, "TraferMoneyForCustomer", new object[] { oSID, "5115378202608031", 123, null, null });
        //object oTrans = WSProxy.CallWebService(strUrlWS, "TraferMoneyForCustomer", new object[] { "lz3ojbvn3zsxcuzjzt4h5lut", "5120823759153587", 12, null, null });

        //Response.Write(oTrans);
        object objDanhMuc = WSProxy.CallWebService(strUrlWS, "Category", paras.ToArray());

        DataTable dt = new DataTable();
        dt = WSProxy.ConvertType<DataTable>(objDanhMuc);

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
}